#ifndef QCOMMONSTRUCT_H
#define QCOMMONSTRUCT_H

#include <qglobal.h>
#include <QVariant>
#include <QString>
#include <QColor>

struct tagComboItem
{
    QString m_text;
    QString m_icon;
};

typedef QList<tagComboItem> ComboItems;

Q_DECLARE_METATYPE(ComboItems)

class tagImageInfo
{
public:
    QString     m_name;
    int         m_type;
    int         m_left;
    int         m_top;
    int         m_right;
    int         m_bottom;
    tagImageInfo(){m_left=m_top=m_right=m_bottom=m_type=0;}
    bool operator ==(const tagImageInfo &info)
    {
        return (info.m_name==m_name &&
                info.m_type==m_type &&
                info.m_left==m_left &&
                info.m_top==m_top &&
                info.m_right==m_right &&
                info.m_bottom==m_bottom);
    }
};

Q_DECLARE_METATYPE(tagImageInfo)

class tagColorInfo
{
public:
    int         m_type;
    QColor      m_color;
    tagColorInfo():m_type(0),m_color(QColor(255,255,255)){}
    bool operator ==(const tagColorInfo &info)
    {
        return (info.m_type==m_type
                && info.m_color==m_color);
    }
};

Q_DECLARE_METATYPE(tagColorInfo)

class tagMemeryValueInfo
{
public:
    QString     m_propertyName;
    QString     m_valueName;
    QString     m_script;
    bool operator ==(const tagMemeryValueInfo &info)
    {
        return (info.m_propertyName==m_propertyName
                && info.m_valueName==m_valueName
                && info.m_script==m_script);
    }
};
typedef QList<tagMemeryValueInfo> MemeryValueItems;
Q_DECLARE_METATYPE(MemeryValueItems)

class tagPaddingInfo
{
public:
    int     m_left;
    int     m_top;
    int     m_right;
    int     m_bottom;
    tagPaddingInfo():m_left(0),m_top(0),m_right(0),m_bottom(0){}
    bool operator== (const tagPaddingInfo &info)
    {
        return (info.m_bottom==m_bottom
                && info.m_top==m_top
                && info.m_left==m_left
                && info.m_right==m_right);
    }
};
Q_DECLARE_METATYPE(tagPaddingInfo)


class tagBorderInfo
{
public:
    int     m_border_width;
    QString m_border_type;
    bool    m_isNull;
    QColor  m_color;

    tagBorderInfo():m_border_width(0),m_border_type("none"),m_isNull(false){}
    bool operator == (const tagBorderInfo &info)
    {
        return (info.m_border_type==m_border_type
             && info.m_border_width==m_border_width
             && info.m_color==info.m_color
             && info.m_isNull==m_isNull);
    }
};
Q_DECLARE_METATYPE(tagBorderInfo)


#endif // QCOMMONSTRUCT_H
